package com.frxuexi.park2212.my

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.SPUtils
import com.frxuexi.lib_base.base.BaseActivity
import com.frxuexi.lib_base.entity.MyHistoryBean
import com.frxuexi.lib_base.net.Const
import com.frxuexi.park2212.R
import com.frxuexi.park2212.databinding.ActivityMyAskBinding
import dagger.hilt.android.AndroidEntryPoint

/**
 * 我的申请页面
 */
@Route(path = "/app/MyAskActivity")
@AndroidEntryPoint
class MyAskActivity : BaseActivity<ActivityMyAskBinding,MyViewModel>() {
    val myHistoryAdapter by lazy { MyHistoryAdapter() }
    override fun initData() {
        vm.parkById.observe(this){
            myHistoryAdapter.addData(MyHistoryBean("车位申请",it.spaceStatus,"申请${it.areaName} ${it.spaceNumber}车位","2025-05-15"
            ))
            myHistoryAdapter.notifyDataSetChanged()
        }
    }

    override fun initView() {
        vm.getParkById(SPUtils.getInstance().getInt(Const.UID))
        binding.rvMy.apply {
            adapter=myHistoryAdapter
            layoutManager=LinearLayoutManager(this@MyAskActivity)
        }
    }

}